﻿namespace Yipusoft.Account.BLL
{
    using System;
    using System.Collections.Generic;
    using Yipusoft.Account.DAL;
    using Yipusoft.Account.Model;

    public class Role
    {
        public static bool AddMenu(string RoleID, string MenuID)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.AddMenu(RoleID, MenuID);
        }

        public static bool AddPermission(string RoleID, string PermissionID)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.AddPermission(RoleID, PermissionID);
        }

        public static bool Delete(string RoleID)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.Delete(RoleID);
        }

        public static bool Exsits(string RoleID)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.Exsits(RoleID);
        }

        public static List<RoleInfo> GetList(string StrWhere)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.GetList(StrWhere);
        }

        public static RoleInfo GetRole(string RoleID)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.GetRole(RoleID);
        }

        public static List<MenuInfo> GetRoleMenuList(string RoleID)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.GetMenuList(RoleID);
        }

        public static List<PermissionInfo> GetRolePermissionList(string RoleID)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.GetPermissionList(RoleID);
        }

        public static bool Insert(RoleInfo Role)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.Insert(Role);
        }

        public static bool RemoveMenu(string RoleID, string MenuID)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.RemoveMenu(RoleID, MenuID);
        }

        public static bool RemovePermission(string RoleID, string PermissionID)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.RemovePermission(RoleID, PermissionID);
        }

        public static bool Update(RoleInfo Role)
        {
            Yipusoft.Account.DAL.Role role = new Yipusoft.Account.DAL.Role();
            return role.Update(Role);
        }
    }
}

